Repository navigation
fix: quantile operand count survives memo sharing; Pass 1 deadline reports the planning budget - #1113
Merged
Merged
Conversation
… out With a zero planning budget, Pass 1's sizing hits its deadline and the facade reported it as "logical ASAP-aware optimization: candidate generation deadline exceeded". Map PerComputationLogicalMemoCandidatesError::Timeout to SelectionError::DeadlineReached, as before P7; other Pass 1 errors keep LogicalASAPCandidates. Fixes joint_search_equivalence::zero_budget_returns_no_unvalidated_plan and stage_pipeline::milp_time_limit_is_reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw
…aring The feasibility seed's DDSketch budget splits a query's relative error over its quantile inputs. It counted distinct quantile nodes by Rc identity. Since P3c (#1106) Pass 1 builds each query's root over the memo groups' nodes, so the two `quantile 0.5` operands of `avg by (job) (q0.5 / q0.5 + q0.9)` are one shared node: the count fell from 3 to 2, the seed admitted sketches sized for half the budget, whose outputs have no accuracy guarantee, and the search spent its whole budget cutting such plans one by one without reaching the exact plan. quantile_operands counts each quantile aggregate as often as the most operands that read it from one path (q / q reads q twice), and a diamond of different parents over one aggregate (an average's sum and count) once, so the count no longer depends on how equal nodes are shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Milestone test phase (part of #1108). This fixes the last two failures from area C (#1111) and merges into
refactor/stage-boundaries.Why
Two failures were left. With guarantees enforced, the ratio of quantiles got no plan, a regression first seen at P3c. With a zero planning budget, the facade reported the wrong error.
What
1.
fix(plan-selection): count quantile operands independently of node sharing.seed_dds_budgets(refinement/planner.rs) splits a query's error budget over its quantile inputs, counted as distinct nodes by pointer identity.quantile_over_time(0.5, …)operands became one node, so the count fell from 3 to 2.quantile_operands(root)now counts a quantile as often as the most operands that read it on one path:q / qcounts 2, while two parents over one quantile, such asavg's sum and count, count 1.2.
fix(planner): report a Pass 1 deadline as the planning budget running out. Inrun.rs, Pass 1'sTimeoutmaps toSelectionError::DeadlineReached, as before P7.How
The root cause was found by logging the old engine's seed proposals at P6b, at P3c and at the head. Each fix comes with a test that fails without it.
Key code interfaces added / modified
Private
quantile_operandsin plan-selection'srefinement/planner.rs;run.rserror mapping.Major algorithm changes
None. This is a heuristic counting fix in today's Stage 3 engine, which #1095 replaces.
Before / After
Verification
New tests:
quantile_operands_count_reads_not_shared_nodes, which builds the ratio over memo groups and checks that the operands really are shared, andquantile_operands_count_a_diamond_once.The four previously failing tests now pass:
ratio_of_quantiles_no_listed_choice_is_cheaper_than_the_selected_planworkload_examples_preserve_data_and_valid_materialized_viewsmilp_time_limit_is_reportedzero_budget_returns_no_unvalidated_planFull runs:
integrationfmt and
clippy --workspace --all-targets -D warningsare clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6bqhAk7WA4MZcfbAoMw